package com.example.demo.model;

import lombok.Data;

@Data
public class ArticleModel {

    Long id;
    Long label_id;
    Long category_id;
    String category_title;
    String title;
    String describe;
    String content;
    int type;
    String type_as;
    String link;
    Long sort;
    int on_shelf;
    int is_del;
    Long total_uv;
    Long total_pv;
    String label_title;
    String create_at;
    String update_at;

    public String getCreate_at() {
        if(this.create_at == null){
            return this.create_at;
        }
        String create_at =this.create_at.replace(".0","");
        return create_at;
    }

    public String getUpdate_at() {
        if(this.update_at == null){
            return this.update_at;
        }
        String update_at =this.update_at.replace(".0","");
        return update_at;
    }

    public String getType_as() {
        switch (this.type) {
            case 1:
                return "文章类";
            case 2:
                return "链接类";
            default:
                return "其他";
        }
    }
}
